package main

import (
	"gin-bms/core"
	"gin-bms/global"
	"gin-bms/initialize"
)
// @title Swagger GINBMS API
// @version 0.0.1
// @description This is a bms Server pets
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name x-token
// @BasePath /
func main() {
	global.GLOBAL_Viper = core.Viper()       // 初始化Viper
	global.GLOBAL_LOG = core.Zap()           // 初始化zap日志库
	global.GLOBAL_DB = initialize.InitGorm() // gorm连接数据库
	initialize.MySqlTables(global.GLOBAL_DB) // 初始化表
	// datas.InitMysqlData(global.GLOBAL_DB)

	// 程序结束前关闭数据库链接
	db, _ := global.GLOBAL_DB.DB()
	defer db.Close()

	initialize.RunWindowsServer()
}
